<template>
	<view class="container">
		<button @click="change" type="submit">Change Password</button>
		<button @click="logout" type="warn">Log Out</button>
	</view>
</template>

<script setup>
	function change() {
		uni.navigateTo({
			url: '/pages/change/change'
		})
	}
	function logout() {
		uni.removeStorage({
			key: 'user-data',
			success: () => {
				uni.showModal({
					title: 'Tip',
					content: 'Logged out',
					showCancel: false,
					confirmText: 'OK'
				});
			},
		});
		uni.removeStorage({
			key: 'phone',
			success: () => {},
		});
		uni.navigateTo({
			url: '/pages/sign/sign'
		})
	}
</script>

<style scoped>
	.container {
		padding: 150rpx 10rpx;
	}
	.container button {
		margin-top: 20rpx;
	}
</style>